// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import './pages/common/common.css'
import router from './router'
import $ from 'jquery'

//http请求
//import axios from 'axios'
//默认值配置
//axios.defaults.baseURL = 'https://api.91war.com';
//axios.defaults.baseURL = 'http://192.168.5.184:8019';
//if(localStorage.t){
	//axios.defaults.headers.common['Authorization'] = localStorage.t;
//}else{
	//location.href="/login";
//}
//axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

// 关键在这里，设置afterEach钩子函数
router.afterEach((to, from, next) => {
  document.title = to.name;
})

//Vue.prototype.$http = axios;

//Vue.config.productionTip = false

// 引入公共js--相当于自定义插件
import common from './pages/common/common'
Vue.use(MintUI)
Vue.use(common)

//store为实例化生成的
import store from './store/index'

//全局组件
import Loading from './components/Loading'
Vue.component('loading', Loading);

//过滤器汇总
import './filter/index'

//自定义指令汇总
import './directive/index'

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App },
  store //注入到vue
})